<%@page import="model.entity.role.Users"%>
<%@page import="model.entity.role.PageTask"%>
<%@ page import="model.entity.product.Product.*"%>
<%@ page import="dao.AbstractDAO"%>
<%@ page import="dao.entity.ProductDAO"%>
<%@ page import="dao.JPAHiberDAOFactory"%>
<%@ page import="java.util.List"%>
<%@ page import=" model.entity.product.Product"%>

<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="css/redtheme-thanh/jquery-ui-1.9.2.custom.css" />
<link rel="stylesheet" type="text/css" href="css/CssTrangChu.css">
<link rel="stylesheet" type="text/css" href="css/Vinh_CSS.css">
<link rel="stylesheet" type="text/css" href="css/Thanh_CSS.css">
<link rel="stylesheet" type="text/css" href="css/Thanh_Masonry.css">
<link rel="stylesheet" type="text/css" href="css/Thanh_Cart.css">

<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.9.2.custom.js"></script>
<script type="text/javascript" src="js/jquery.nivo.slider.js"></script>
<script type="text/javascript" src="js/simpla.jquery.configuration.js"></script>
<script type="text/javascript" src="js/jquery.masonry.min.js"></script>
<script type="text/javascript" src="js/Script_Vinh.js"></script>
<script type="text/javascript" src="js/Script_Thanh.js"></script>
<title>Dang nhap dang ky</title>

<script type="text/javascript">
$(function() {
	var $container = $('#productContainer');
	$container.imagesLoaded(function(){
	  $container.masonry({
	    itemSelector : '.products-box'
	  });
	});
});
</script>
</head>
<body>

<%
		String email_err = "";
		if(request.getAttribute("email_err") != null){
//		ép kiểu
			email_err = (String) request.getAttribute("email_err");
		}
//		giu lai thong tin nguoi dung
		String email = "";
		if(request.getAttribute("email") != null){
//		ép kiểu
			email = (String) request.getAttribute("email");
		}
		
		String password_err ="";
		if(request.getAttribute("password_err") != null){
			password_err = (String) request.getAttribute("password_err");
		}
		
		String password = "";
		if(request.getAttribute("password") != null){
			password = (String) request.getAttribute("password");
		}
		
		String re_password = "";
		if(request.getAttribute("re_password") != null){
			re_password =(String) request.getAttribute("re_password");
		}
		
		
		
		String phone_err = "";
		if(request.getAttribute("phone_err") != null){
			phone_err = (String) request.getAttribute("phone_err");
		}
		
		String phone = "";
		if(request.getAttribute("phone") != null){
			phone = (String) request.getAttribute("phone");
		}
		

		String homeadd_err = "";
		if(request.getAttribute("homeadd_err") != null){
			homeadd_err = (String) request.getAttribute("homeadd_err");
		}
		
		String homeadd = "";
		if(request.getAttribute("homeadd") != null){
			homeadd = (String) request.getAttribute("homeadd");
		}
		
		
	%>

	<div id="nen">
	
			
		<div id="khungGiua">
			<% Users user = (Users) session.getAttribute("user"); %>
<div id="tieuDe">
	<div id="taiKhoan">
		<ul>
		<% if(user == null) { %>
			<li><a class="jqButton" href="DanhNhapDangKy.jsp">Đăng nhập - Đăng Ký</a></li>
		<%} else {  List<PageTask> listTask = user.getGroupRole().getPageTasks(); %>
				<li><a>Chào <%=user.getFullName() %></a></li>
			<% for(PageTask task : listTask) { %>
				<li><a class="jqButton" href="<%=task.getCommandLink()%>"><%=task.getTaskName()%></a></li>
			<%} %>
			<li><a class="jqButton" href="../UserLogin?command=signOutH" >Đăng Xuất</a></li>
		<% } %>
		</ul>
	</div>
	<div id="khungTen">
		<iframe src="http://localhost:8087/NongLam_Web_FashionShop/shop/header/timeline.html" height="360px" style="width: 958px;"></iframe>
	</div>
	<!-- khung menu -->

	<div id="khungMenu">
		<div class="content">
			<ul id="sdt_menu" class="sdt_menu">
				<li><a href="TrangChu.jsp"> <img src="images/shop/menuFashion.jpg" alt="" />
						<span class="sdt_active"></span> <span class="sdt_wrap"> <span
							class="sdt_link">fashon shop</span> <span class="sdt_descr">thời
								trang cho tuổi teen</span>
					</span>
				</a></li>
				<li><a href="../FilterProduct?type=theme&nameOfType=Teen"> <img src="images/shop/menuHangMoi.jpg" alt="" />
				<span class="sdt_active"></span> <span class="sdt_wrap"> <span
							class="sdt_link">hàng hot</span> <span class="sdt_descr">sản
								phẩm bán chạy nhất</span>
					</span>
				</a></li>
				<li><a href="DanhSachSanPham.jsp"> <img src="images/shop/menuNew.jpg" alt="" />
						<span class="sdt_active"></span> <span class="sdt_wrap"> <span
							class="sdt_link">new</span> <span class="sdt_descr">hàng
								mới về</span>
					</span>
				</a></li>
				<li><a href="#"> <img src="images/shop/menuAoDoi.jpg" alt="" />
						<span class="sdt_active"></span> <span class="sdt_wrap"> <span
							class="sdt_link">áo đôi</span> <span class="sdt_descr">thời
								trang cặp đôi</span>
					</span>
				</a></li>
				<li><a href="#"> <img src="images/shop/menuLinhTinh.jpg" alt="" />
						<span class="sdt_active"></span> <span class="sdt_wrap"> <span
							class="sdt_link">linh tinh</span> <span class="sdt_descr">phụ
								kiển thời trang</span>
					</span>
				</a></li>
				<li><a href="#"> <img src="images/shop/menuSale.jpg" alt="" />
						<span class="sdt_active"></span> <span class="sdt_wrap"> <span
							class="sdt_link">sale off</span> <span class="sdt_descr">hàng
								giảm giá</span>
					</span>
				</a></li>
			</ul>
		</div>
	</div>

</div>
			
			<div style="clear: left;"></div>
			
			<div id="noiDung">

				<div id="khungDangNhapDangKy">
					<div id="tenDNDK">đăng nhập hoắc đăng ký thành viên mới</div>
					<div id="dangNhapDangKy">
						<div class="dangNhap">
							<ul>
								<li>bạn là thành viên của fashion shop</li>
								<form action="UserLogin" method="post">
									<table class="canLeTable">
										<tr>
											<td>tên đăng nhập</td>  <td><input type="text" name="username" placeholder="Username" required="required" style="width: 150px;"></td>
										</tr>
										<tr>
											<td>mật khẩu </td> <td><input type="password" name="password" required="required" style="width: 150px;" ></td>
										</tr>
										<tr>
											<td><button type="submit" title="dang nhap">ĐĂNG NHẬP</button></td>
										</tr>								
									</table>
								</form>
							</ul>
						</div>
						<div class="dangKy">
							<ul>
								<li>đăng ký tài khoản mới</li>
								<form action="XuLyDangKy" method="post">
									<table class="canLeTable">
										<tr>
											<td>email</td>  <td><input type="text" style="width: 150px;" name="email" value="<%=email%>" ></td>
											<td><font style="color: red;font-size: 10pt;"> * <%=email_err%></font></td>
										</tr>
										<tr>
											<td>mật khẩu </td> <td><input type="password" style="width: 150px;" name="password" value="<%=password%>"></td>
											<td><font style="color: red;font-size: 10pt;">*<%=password_err%></font></td>
										</tr>
										<tr>
											<td>nhập lại mật khẩu </td> <td><input type="password" style="width: 150px;" name="re_password" value="<%=re_password%>"></td>
											<td><font style="color: red;font-size: 10pt;">*<%=password_err%></font></td>
										</tr>
										<tr>
											<td>số điện thoại </td> <td><input type="text" style="width: 150px;" name="phone" value="<%=phone%>"></td>
											<td><font style="color: red;font-size: 10pt;">*<%=phone_err%></font></td>
										</tr>
										<tr>
											<td>địa chỉ </td> <td><textarea rows="5" cols="16" name="homeadd"></textarea></td>
											<td><font style="color: red;font-size: 10pt;">*<%=homeadd_err%></font></td>
										</tr>
										<tr>
											<td><input type="submit" value="ĐĂNG KÝ"/><input type="reset" value="XÓA FROM"/></td>
										</tr>								
									</table>
								</form>
							</ul>
						</div>
					</div>
				</div>

			</div>
			<!-- dong the noi dung -->

		</div>

	</div>

</body>
</html>